package smb.web;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import smb.util.FileItem;
import smb.util.SmbUtil;
import smb.web.exception.ParameterException;

public class SmbController {
	public ArrayList<FileItem> list(HttpServletRequest req,HttpServletResponse res) throws Exception{
		String path = req.getParameter("path");
		if(path == null) {
			throw new ParameterException("缺失path参数");
		}
		path = new String(path.getBytes("ISO-8859-1"),"utf-8");
		return SmbUtil.getFiles(path);
	}
}
